package com.iking.housekeeping.common;

/**
 * web返回类
 * 
 * @author 张重阳
 *
 */
public class ReturnCode {

	/**
	 * 状态(错误)码
	 */
	private Integer code;

	/**
	 * 返回消息
	 */
	private String msg;

	/**
	 * 返回数据
	 */
	private Object data;
	
	public ReturnCode() {
		this(CodeEnum.SUCCESS);
	}

	public ReturnCode(CodeEnum codeEnum) {
		this(codeEnum, codeEnum.msg());
	}
	
	public ReturnCode(CodeEnum codeEnum, Object data) {
		this(codeEnum, codeEnum.msg(), data);
	}

	public ReturnCode(CodeEnum codeEnum, String msg, Object data) {
		this.code = codeEnum.val();
		this.msg = msg;
		this.data = data;
	}

	public Integer getCode() {
		return code;
	}

	public String getMsg() {
		return msg;
	}

	public Object getData() {
		return data;
	}

}
